// pages/index/photoprint/copy.js
Page({

  /**
   * 页面的初始数据
   */
  data: {goods_id:'',near_id:'',last:''

  },

  onLoad: function (options) {
    console.log(options);
    
    if(options.goods_id){
      this.setData({
        goods_id:options.goods_id,
        near_id:options.near_id
      })
    }
  },

  onShow: function () {

  },
  navid(){
   this.throttle(()=>{
    wx.navigateTo({
      url: '/pages/edit3/edit3?near_id='+this.data.near_id+'&goods_id='+this.data.goods_id+'&type=1',
    })
   },1000)
  },
  navhukouben(){
    wx.navigateTo({
      url: '/pages/edit3/edit3?near_id='+this.data.near_id+'&goods_id='+this.data.goods_id+'&type=3',
    })
  },
  navxuesheng(){
    wx.navigateTo({
      url: '/pages/edit3/edit3?near_id='+this.data.near_id+'&goods_id='+this.data.goods_id+'&type=2',
    })
  },
  navchusheng(){
    wx.navigateTo({
      url: '/pages/edit7/edit7?near_id='+this.data.near_id+'&goods_id='+this.data.goods_id,
    })
  },
  navimgtext(){
    wx.navigateTo({
      url: '/pages/edit10/edit10?near_id='+this.data.near_id+'&goods_id='+this.data.goods_id,
    })
  },
  navjiashi(){
    wx.navigateTo({
      url: '/pages/edit15/edit15?near_id='+this.data.near_id+'&goods_id='+this.data.goods_id
    })
  },
  //节流
throttle:function(func,wait){
  console.log(func,wait);
  
  let last =this.data.last
  console.log(last);
  
  let current_time= +new Date()
  if(current_time-last>wait){
    console.log(1111);
      console.log(current_time,current_time-last);
      
      func()
      last=+new Date()
      this.setData({
        last
      })
  }
    
     
  
   
},

 
})